FROM maven:3.3-jdk-8 AS build-env
COPY ./settings.xml /root/.m2/settings.xml
COPY ./ /usr/src/mymaven
WORKDIR /usr/src/mymaven
RUN mvn clean install

FROM openjdk:8-jdk-alpine
COPY --from=build-env /usr/src/mymaven/target/*.jar app.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]